<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class stamp_model extends CI_Model{

	function __construct()
    {
        // Call the Model constructor
        parent::__construct();
    }
	
	function get_all_stamp()
	{
		$this->db->select('*');
		$this->db->from('stamp');
		$query = $this->db->get();
		return $query->result();
	}
	
	function get_stamp_by_id($stamp_id)
	{
		$this->db->select('*');
		$this->db->from('stamp');
		$this->db->where('stamp_id', $stamp_id);
		$query = $this->db->get();
		return $query->result();
	}
	
	function get_stamp_by_path($stamp_path)
	{
		$this->db->select('*');
		$this->db->from('stamp');
		$this->db->where('stamp_path', $stamp_path);
		$query = $this->db->get();
		return $query->result();
	}
	
	function get_stamp_by_created_date($created_date)
	{
		$this->db->select('*');
		$this->db->from('stamp');
		$this->db->where('created_date', $created_date);
		$query = $this->db->get();
		return $query->result();
	}
	
	function get_stamp_by_update_date($update_date)
	{
		$this->db->select('*');
		$this->db->from('stamp');
		$this->db->where('update_date', $update_date);
		$query = $this->db->get();
		return $query->result();
	}
	
	function save($stamp_id, $stamp){
	
		$this->db->where('stamp_id', $stamp_id);
		$this->db->update('stamp', $stamp); 
	}
	
	
}